#pragma once
#include <sw/redis++/redis.h>
#include <iostream>

class RedisClientFactory 
{
    public:
    static std::shared_ptr<sw::redis::Redis> create(const std::string& host,int port,int db,bool keep_alive) 
    {
        sw::redis::ConnectionOptions opts;
        opts.host = host;
        opts.port = port;
        opts.db = db;
        opts.keep_alive = keep_alive;
        auto res = std::make_shared<sw::redis::Redis>(opts);
        return res;
    }
};



